package org.jeecg.modules.app.controller;

import com.baomidou.mybatisplus.core.metadata.IPage;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.jeecg.common.api.vo.Result;
import org.jeecg.modules.api.announcement.service.IAnnouncementService;
import org.jeecg.modules.api.order.entity.Order;
import org.jeecg.modules.api.order.service.IOrderService;
import org.jeecg.modules.app.service.IAppOrderService;
import org.jeecg.modules.app.vo.IndexVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @Description: 订单相关接口
 * @author: Young Jun
 * @date: 2024年09月30日 16:12
 */
@Api(tags="小程序订单相关接口")
@RestController
@RequestMapping("/app/order")
@Slf4j
public class AppOrderController {

    @Autowired
    private IAppOrderService appOrderService;

    @GetMapping("/getOrderByPage")
    @ApiOperation(value = "订单列表", notes = "订单列表")
    public Result<IPage<Order>> getOrderByPage(
            @RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
            @RequestParam(name="pageSize", defaultValue="10") Integer pageSize) {
        return Result.OK(appOrderService.getOrderByPage(pageNo,pageSize));
    }
}
